package com.conan.dailyflickr.provider;

import android.net.Uri;
import android.provider.BaseColumns;

import com.conan.dailyflickr.app.PhotoDailyInfo;

public class DailyFlickrDBConstants {
    public static final String DATABASE_NAME 		= "dailyflickr.db";
    
    public static final int VER_ORIGINAL = 2;
    public static final int VER_ADD_METAR = 3;
    
    public static final int DATABASE_VERSION = VER_ADD_METAR;
    
    public static String AUTHORITY = "com.handroid.dailyflickr";
    
	public static final String TABLE_PHOTO_NAME = "photos_table";
	public static final int TABLE_PHOTO_ID = 101;

	public static final String[] mPhotoColumn = {
		PhotoDailyInfo.RESPONSE_ATTR_ID,		// 0
		PhotoDailyInfo.RESPONSE_ATTR_SECRET,	// 1
		PhotoDailyInfo.RESPONSE_ATTR_SERVER,	// 2
		PhotoDailyInfo.RESPONSE_ATTR_FARM,		// 3
		PhotoDailyInfo.RESPONSE_ATTR_TITLE,		// 4
		PhotoDailyInfo.RESPONSE_ATTR_DATE_TAKEN // 5
	};
	
	public static final String[] mSqlCreateTable = {
		 "create table " + 
		 TABLE_PHOTO_NAME + "(" +
		 mPhotoColumn[0] + " TEXT, " +
		 mPhotoColumn[1] + " TEXT, " +
		 mPhotoColumn[2] + " TEXT, " +
		 mPhotoColumn[3] + " TEXT, " +
		 mPhotoColumn[4] + " TEXT, " +
		 mPhotoColumn[5] + " TEXT, " +
		 " PRIMARY KEY(" + mPhotoColumn[0] +")); "
	};
	
	public static String mQueryStrForAllItemInWorksTable = 
		"SELECT * FROM " + TABLE_PHOTO_NAME + 
		" ORDER BY " + mPhotoColumn[5] + " DESC";

}
